/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.freshdirect.src.model;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Ilias
 */
public class Order {
   
   private int Id;
   List<Product> products; 
   private double totalPrice;
   private Timestamp date;

    public int getId() {
        return Id;
    }

    public void setId(int Id) {
        this.Id = Id;
    }

    public Timestamp getDate() {
        return date;
    }

    public void setDate(Timestamp date) {
        this.date = date;
    }


    public Order() {
        this.products = new ArrayList<Product>();
    }
   

    public List<Product> getProducts() {
        return products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }
    
    
    public void removeProduct(int id){
        for(int i=0; i<products.size(); i++){
            if(products.get(i).getId()==id){
                products.remove(i);
            }
        }
    }
    
    public double getTotalPrice(){
        return totalPrice;
    }


    public void setTotalPrice(double i) {
        this.totalPrice = i;
    }
}
